import RoomItem from '@/components/room-item'
import React, { memo } from 'react'
import { RoomsWrapper } from './style'

const SectionRooms = memo((props) => {
  const { roomList = [], itemWidth } = props

  return (
    <RoomsWrapper>
      {/* 只展示前 8 条 */}
      {roomList.slice(0, 8).map((item) => {
        return <RoomItem key={item.id} itemData={item} itemWidth={itemWidth} />
      })}
    </RoomsWrapper>
  )
})

export default SectionRooms
